<template>
  <div>
    <el-row>
      <el-col :span="24">
        <el-form :inline="true" class="demo-form-inline">
          <el-form-item>
            <el-input
              size="medium"
              v-model="queryStr"
              placeholder="查询"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button size="small" type="primary" icon="el-icon-search"
              >查询</el-button
            >
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="24">
        <div>
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="date" label="产品名称" width="">
            </el-table-column>
            <el-table-column prop="name" label="产品分类" width="">
            </el-table-column>

            <el-table-column prop="address2" label="库存数量">
            </el-table-column>
            <el-table-column prop="unit" label="产品单位"> </el-table-column>
            <el-table-column prop="total" label="总价"> </el-table-column>
            <el-table-column prop="address3" label="入库员"> </el-table-column>
            <el-table-column prop="address4" label="日期"> </el-table-column>
            <el-table-column prop="address5" label="备注"> </el-table-column>
            <el-table-column label="操作" width="220" align="center">
              <template #default="scope">
                <el-button
                  size="mini"
                  @click="handleEdit(scope.$index, scope.row)"
                  >出库</el-button
                >
                <el-button
                  size="mini"
                  @click="handleEdit(scope.$index, scope.row)"
                  >编辑</el-button
                >
                <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-col>
    </el-row>
    <el-dialog
      :title="single"
      v-model="plassets"
      width="70%"
      :close-on-click-modal="false"
    >
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="plassets = false">取 消</el-button>
          <el-button type="primary" v-if="under == 1" @click="determine()"
            >确 定</el-button
          >
          <el-button @click="hardware()" v-else type="primary"
            >编辑 确 定</el-button
          >
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      plassets: false,
      queryStr: "",
      under: 1,
      single: "",
      tableData: [
        {
          date: "书籍",
          name: "办公用品",
          date1: "100",
          address: "入库",
          address1: "本",
          address2: "100",
          address3: "张三",
          total: "",
          unit: "本",
          address4: "2021/5/11",
          address5: "xxxxxxx",
        },
      ],
    };
  },
  methods: {
    storage(index) {
      this.under = index;
      this.single = "新增";
      this.plassets = true;
    },
  },
};
</script>

<style scoped>
.addccc {
  margin-bottom: 20px;
}
</style>